<script langt="ts" setup>
// import {ref} from "vue"
// const route
import { onBeforeMount, ref, nextTick } from "vue";
import { userStore } from "@/store/user";
import { useRouter, useRoute } from "vue-router";
const show = ref(true);
const store = userStore();
const router = useRouter();
const route = useRoute();
onBeforeMount(async () => {
  await store.setRoutes();
  reflash();
});
const reflash = () => {
  if (route.fullPath != "/login") {
    router.push(route.fullPath);
  }
};
</script>
<template>
  <router-view v-slot="{ Component, route }" v-if="show">
    <keep-alive>
      <component :is="Component" />
    </keep-alive>
  </router-view>
</template>
